package com.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.common.ajax.AjaxRes;
import com.common.utils.base.UuidUtil;
import com.entity.TouSuJianYi;
import com.service.TouSuJianYiService;
@Controller
@RequestMapping("/tousujianyi/manager")
public class TouSuJianYiController {
	@Autowired
	private TouSuJianYiService tsjyService;
	
	@RequestMapping("/addtsjy")
	@ResponseBody
	public AjaxRes addtsjy(String tsnr,String yhId){
		String tsId=UuidUtil.get32UUID();
		TouSuJianYi o = new TouSuJianYi();
		o.setId(tsId);
		o.setTsr(yhId);
		o.setTsnr(tsnr);
		AjaxRes res = new AjaxRes();
		try {
			tsjyService.insert(o);
			res.setResMsg("提交成功");
		} catch (Exception e) {
			System.out.println("ER:"+e.getMessage());
			res.setResMsg("提交失败");
		}
		return res;
	}
}
